#include <stdio.h>
#define BUFSIZE 32
int main(int argc, char **argv)
{
	FILE *fp = NULL;
	char  * c = NULL;
	char buf[BUFSIZE] = {0};
	int a = 0;
	//打开文件，返回文件流
	fp = fopen (argv[1], "r");
	if(NULL == fp) {
		printf("fopen failed!\n");
		return -1;
	}
	while(1){
		a = fread (argv[1],1,BUFSIZE,fp);
		if(0 == a) {
			//如果发生错误
			if (ferror(fp)){
				fprintf(stderr, "fgetc () error!\n");
				fclose (fp);
				return 0;
			}
			break;
		}
	fwrite(argv[1],1,a,stdout);
	fflush(NULL);//刷新所有的输出流
	}
	fclose(fp);
	return 0;
}
